package com.fjxd.ticketStore.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.fjxd.ticketStore.pojo.TicketStore;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author csw
 */
@Service
public interface TicketStoreService extends IService<TicketStore> {
    /**
     * 下单成功扣除机票库存
     *
     * @param ticketId    机票id
     * @param ticketType  机票座位类型
     * @param ticketCount 机票数量
     */
    void ticketDeduct(String ticketId, Integer ticketType, Integer ticketCount);


    /**
     * 下单改签，机票库存回增
     *
     * @param aircraftTicketId 机票id
     * @param ticketCount      机票数量
     */
    void ticketGoBack(Integer aircraftTicketId, Integer ticketCount);


    /**
     * 通过机票id对应的机票座位余数
     *
     * @param ticketId 机票id
     * @return 返回机票id对应的机票座位余数
     */
    List<TicketStore> getTicketCount(Integer ticketId);
}
